﻿<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->
<common:LayoutAwarePage
    x:Class="Tiles.SendWebImageTile"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Tiles"
    xmlns:common="using:SDKTemplate.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid x:Name="Input" Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <StackPanel>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold" Margin="0,0,0,10">
                    This scenario demonstrates how to send tile notifications with web images.
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap">
                    Tile notifications can specify web images.
                    These images can be referenced using the http:// or https:// protocols. Images must be in .png, .jpg, .jpeg, or .gif format and can have a maximum size of 200KB and maximum dimensions of 1024x1024.
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold" Margin="0,10,0,0">
                    Specify the URL of an image:
                </TextBlock>
                <TextBox x:Name="ImageUrl" Text="http://" />

                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold" Margin="0,20,0,0">
                    Send using the Notifications Extensions Library:
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" >
                    For the first example, we use the Notifications Extensions Library to build the notification payload.
                </TextBlock>
                <StackPanel Orientation="Horizontal">
                    <Button x:Name="UpdateTileWithWebImage" Content="Send tile notification with web images" Click="UpdateTileWithWebImage_Click" />
                    <Button x:Name="ClearTile" Content="Clear tile" Click="ClearTile_Click"/>
                </StackPanel>

                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold" Margin="0,20,0,0">
                    Send by constructing your own payload:
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap">
                    Since notifications are simply XML, you can create them in many different ways. For example, here we create notifications by constructing strings.
                </TextBlock>
                <StackPanel Margin="0,10,0,0">
                    <Button x:Name="UpdateTileWithWebImageWithStringManipulation" Content="Send tile notification created with strings" Click="UpdateTileWithWebImageWithStringManipulation_Click"/>
                </StackPanel>
            </StackPanel>
        </Grid>

        <Grid x:Name="Output" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1">
            <TextBlock x:Name="OutputTextBlock" Text="" TextWrapping="Wrap"  Style="{StaticResource BasicTextStyle}" IsTextSelectionEnabled="True"/>
        </Grid>

        <!-- Add Storyboards to the visual states below as necessary for supporting the various layouts -->
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="DefaultLayout"/>
                <VisualState x:Name="Below768Layout"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>

</common:LayoutAwarePage>
